<?php

class Skjb_Db_Table_Row_Registry
{
    private static $_data = array();
    
    public static function setItem($table, $id, $value)
    {
        if (!isset(self::$_data[$table])) {
            self::$_data[$table] = array();
        }
        
        self::$_data[$table][$id] = $value;
    }
    
    public static function getItem($table, $id)
    {
        if (!isset(self::$_data[$table])) {
            return false;
        }
        
        if (!isset(self::$_data[$table][$id])) {
            return false;
        }
        
        return self::$_data[$table][$id];
    }
    
    public static function clear($table = null)
    {
        if (null !== $table) {
            unset(self::$_data[$table]);
            return;
        }
        
        self::$_data = array();
    }
}